package com.tarena.lbs.basic.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.basic.pojo.po.AreaPO;
import com.tarena.lbs.basic.pojo.vo.AreaVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AreaMapper extends BaseMapper<AreaPO> {
    @Select("select id,parent_id,name from lbs_area where parent_id = 0")
    List<AreaVO> queryProvinces();

    @Select("select id,parent_id,name from lbs_area where parent_id = #{parentId}")
    List<AreaVO> queryChildren(Integer parentId);
}
